<?php 
//update_option('siteurl','http://localhost:8080/thaotien');update_option('home','http://localhost:8080/thaotien');
function register_my_menu() {
  register_nav_menu('header-menu',__( 'Header Menu' ));
}
function t($data,$exit=1) {
	echo '<pre style="text-align:left;">';
	print_r($data);
	echo '</pre>';
	if($exit)exit;
}
function get_first_image_src($content,$type='thumb'){  
  $matches=array();
  
  $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $content, $matches);
  $first_img = $matches [1] [0];
  return $first_img;
}	
function content_with_gallery($content){
	return do_shortcode($content);
}
function script_style(){
	//wp_enqueue_script('custom_common', get_template_directory_uri() . '/js/without_jquery/common.js');
	//wp_enqueue_script('first_load', get_template_directory_uri() . '/js/first_load.js', array( 'jquery' ));
	//wp_enqueue_style('editor_style',get_template_directory_uri() . '/css/editor-style.css',array());	
}
function home_style(){
	//wp_enqueue_style('home',get_template_directory_uri() . '/css/home.css',array());
}
function courses_style(){
	wp_enqueue_style('courses',get_template_directory_uri() . '/css/courses.css',array());
}
function booking_style(){
	wp_enqueue_style('booking',get_template_directory_uri() . '/css/booking.css',array());
}
function video_style(){
	wp_enqueue_style('video',get_template_directory_uri() . '/css/video.css',array());
}
function is_category_in($catname){
	$cats=array('static');
	return in_array($catname, $cats);
}

function mytheme_tinymce_config( $init ) {
 $valid_iframe = 'iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]';
 if ( isset( $init['extended_valid_elements'] ) ) {
  $init['extended_valid_elements'] .= ',' . $valid_iframe;
 } else {
  $init['extended_valid_elements'] = $valid_iframe;
 }
 return $init;
}
add_filter('tiny_mce_before_init', 'mytheme_tinymce_config');
add_action( 'wp_enqueue_script', 'script_style' );
add_action( 'wp_enqueue_script', 'home_style' );
add_action( 'init', 'register_my_menu' );
?>